import request from '@/utils/request'

const baseUrl = '/threshold-warn-back/threshold-warn-back/v1.0/'
const apiHome = {
  // 健康监测遥测参数管理
  satellites: function (params) {
    return request({
      url: baseUrl + 'structure/satellites',
      method: 'get',
      params
    })
  },
  getSelectParams: function (data) {
    return request({
      url: baseUrl + 'structure/params',
      method: 'get',
      params: data
    })
  },
  // /monitor/param/add
  addParams: function (data) {
    return request({
      url: baseUrl + 'monitor/param/add',
      method: 'post',
      data
    })
  },
  getPageList: function (data) {
    return request({
      url: baseUrl + 'monitor/param/list/page',
      method: 'post',
      data
    })
  },
  updateSelectParams: function (data) {
    return request({
      url: baseUrl + 'monitor/param/update',
      method: 'post',
      data
    })
  },
  deleteOperatorMgr: (data) => {
    return request({
      url: baseUrl + 'monitor/param/delete',
      method: 'get',
      params: data
    })
  },
  // 多级门限管理
  getConstantSelect: (data) => {
    // /monitor/param/list/All
    return request({
      url: baseUrl + 'threshold/params/list/',
      method: 'get',
      params: data
    })
  },
  // 新增/threshold/add
  addThresholdParams: function (data) {
    return request({
      url: baseUrl + 'threshold/add',
      method: 'post',
      data
    })
  },
  // 删除
  deleteThresholdOperatorMgr: (data) => {
    return request({
      url: baseUrl + 'threshold/delete',
      method: 'get',
      params: data
    })
  },
  // 修改/threshold/update
  updatethresholdSelectParams: function (data) {
    return request({
      url: baseUrl + 'threshold/update',
      method: 'post',
      data
    })
  },
  // 获取列表
  getThresholdPageList: function (data) {
    return request({
      url: baseUrl + 'threshold/list/page',
      method: 'post',
      data
    })
  },
  // algorithmModelBinding/algorithmModelBinding
  // 更新模板状态
  updateTemplateStatus: function (data) {
    return request({
      url: baseUrl + 'threshold/update/state',
      method: 'get',
      params: data
    })
  },
  // 门限算法绑定列表
  getAlgorithmModelBinding: function (data) {
    return request({
      url: baseUrl + 'threshold/list/bind',
      method: 'post',
      data
    })
  },
  // 测试 获取星结构信息
  getStarStructInfo: function (data) {
    return request({
      url: baseUrl + 'structure/getSatInfoFromUrl',
      method: 'get',
      params: data
    })
  },
  // 根据参数ID 获取已绑定参数的多级门限模板
  getThresholdTemplate: function (data) {
    return request({
      url: baseUrl + 'binding/paramBindingList',
      method: 'get',
      params: data
    })
  },
  // 多级门限绑定
  bindThresholdTemplate: function (data) {
    return request({
      url: baseUrl + 'binding/addBinding',
      method: 'post',
      data
    })
  },
  // 获取绑定详情
  getBindingDetail: function (id) {
    return request({
      url: baseUrl + `binding/getBindingDetail/${id}`,
      method: 'get'
    })
  },
  // 修改绑定
  updateBinding: function (data) {
    return request({
      url: baseUrl + 'binding/updateBinding',
      method: 'put',
      data
    })
  },
  // 解除绑定
  unbindThresholdTemplate: function (id) {
    return request({
      url: baseUrl + `binding/removeBinding/${id}`,
      method: 'delete'
    })
  },
  // 多级门限 订阅列表
  getThresholdSubscribeList: function (data) {
    return request({
      url: baseUrl + 'binding/bindingPage',
      method: 'get',
      params: data
    })
  },
  getDevicesTree: function () {
    return request({
      url: baseUrl + '/structure/devices',
      method: 'get'
    })
  },
  // 根据设备ID获取参数列表
  getParamListByDeviceId: function (data) {
    return request({
      url: baseUrl + 'monitor/param/paramList',
      method: 'get',
      params: data
    })
  }
}
export { apiHome }
